using System;
using System.Collections.Generic;
using System.Text;



namespace testcuda
{
    class Program
    {
        static void Main(string[] args)
        {
            CudaCalls.CallCudaFunction cuda = new CudaCalls.CallCudaFunction();

            int ret = cuda.Call_init_cuda();
            if (ret != 0)
            {
                Console.WriteLine("Could not initialize CUDA!");
                return;
            }

            float[] input = {3, 1, 2, 2, 1.2f, 1.1f, 3, 1.7f, 1, 3, 2.5f, 1, 1.5f, 1};
            uint sizex, sizey;
            sizex = 2;
            sizey = 7;

            float[] out1 = cuda.Call_run_pdist(input, sizex, sizey);
            float[] out2 = cuda.Call_lower_triangle(out1, sizey);
            float[] out3 = cuda.Call_run_linkage(out2, sizey);

            for (int y = 0; y < (sizey-1); y++)
            {
                Console.WriteLine(string.Format("{0} {1} {2}", out3[y*3], out3[y*3+1], out3[y*3+2]));
            }
            Console.ReadLine();
        }
    }
}
